﻿using System;
using System.Runtime.Serialization;

namespace UrimTumim.Timesheet.Services.DataContracts
{
    /// <summary>
    /// Represents a timesheet entry.
    /// </summary>
    [DataContract]
    public abstract class TimesheetData
    {   
        /// <summary>
        /// Identifier that uniquely identifies a Timesheet Entry. 
        /// </summary>
        [DataMember]
        public Guid? TimesheetEntryGuid { get; set; }

        /// <summary>
        /// Identifier as an integer to mantain compatibility with older systems.
        /// </summary>
        /// <remarks>
        /// Must be used with TimesheetDomain.
        /// </remarks>
        [DataMember]
        public long? TimesheetEntryId { get; set; }

        /// <summary>
        /// Domain where the timesheet entry belongs.
        /// It could be the company name or a department name.
        /// </summary>
        [DataMember]
        public string TimesheetDomain { get; set; }

        /// <summary>
        /// User name that uniquely identifies a Timesheet User. 
        /// </summary>
        [DataMember]
        public string UserName { get; set; }

        /// <summary>
        /// Start time of Timesheet Entry.
        /// </summary>
        [DataMember]
        public DateTime Start { get; set; }

        /// <summary>
        /// Finish time of Timesheet Entry.
        /// </summary>
        [DataMember]
        public DateTime? Finish { get; set; }

        /// <summary>
        /// Break interval during the timesheet entry.
        /// </summary>
        [DataMember]
        public TimeSpan? BreakInterval { get; set; }

        /// <summary>
        /// Comment about Timesheet Entry.
        /// </summary>
        [DataMember]
        public string Comment { get; set; }

        /// <summary>
        /// Timesheet's Task instance.
        /// </summary>
        [DataMember]
        public TaskData Task { get; set; }
    }
}
